import java.util.Random;
import java.util.Scanner;

/**
 * Created by dllo on 3/30/18.
 */
public class Test04 {
    public static void main(String[] args) {

        Random random = new Random(); // 用来生成随机数
        Scanner scanner = new Scanner(System.in);


        int target = random.nextInt(100);// 随机生成的数字

        int num = -1;

        do {
            System.out.println("猜一个数");
            num = scanner.nextInt();

            if (num > target) {
                System.out.println("猜大了");
            } else if (num < target) {
                System.out.println("猜小了");
            }
        } while (num != target);

        System.out.println("猜对了");
    }
}